<template>
	<view>
		<u-sticky>
			<!-- 标签控件 -->
			<view class="tab-swiper" v-if="bigType == 1 || bigType == 2">
				<u-tabs-swiper
					activeColor="#1573FF"
					ref="tabs"
					:list="list"
					:current="current"
					@change="tabChange"
					:is-scroll="false"></u-tabs-swiper>
			</view>

			<!-- 搜索框 -->
			<view class="navi-search">
				<u-search
					placeholder="请输入车牌号/车架号/客户名称/维修项目"
					v-model="mKeyWords"
					:show-action="false"
					@search="searchDidFinish"
					@change="searchChange"></u-search>
			</view>
		</u-sticky>

		<mescroll-body
			ref="mescrollRef222"
			@init="mescrollInit"
			@down="downCallback"
			@up="upCallback">
			<view v-for="(itemData, index) in listdata" :key="index">
				<view class="item">
					<view
						style="
							height: 80rpx;
							display: flex;
							justify-content: space-between;
							align-items: center;
							margin-left: 20rpx;
						">
						<text class="title">
							{{ itemData.approveNode | filterNull }}
						</text>
						<text
							style="
								color: white;
								font-size: 22rpx;
								padding: 5rpx 10rpx;
								background-color: #ffc500;
								border-radius: 50rpx 0 0 50rpx;
							">
							{{ itemData.approveStatusStr | filterNull }}
						</text>
					</view>

					<u-line
						color="#efefef"
						:customStyle="{ 'margin-bottom': '30rpx', display: 'block' }"></u-line>

					<view
						v-if="
							itemData.applyType == 1 ||
							itemData.applyType == 2 ||
							itemData.applyType == 3 ||
							itemData.applyType == 4 ||
							itemData.applyType == 5 ||
							itemData.applyType == 7 ||
							itemData.applyType == 8 ||
							itemData.applyType == 9 ||
							itemData.applyType == 11
						">
						<view class="text-line">
							<text class="text-name">车辆订单号:</text>
							<text class="text-value">{{ itemData.orderCarCode | filterNull }}</text>

							<text
								v-if="itemData.rentType !== 6"
								style="
									font-size: 26rpx;
									color: #ffc500;
									border: #ffc500 2rpx solid;
									padding: 0 10rpx;
									border-radius: 6rpx;
									margin-right: 20rpx;
								">
								{{ itemData.tenancy | filterNull }}
							</text>
						</view>

						<view class="text-line">
							<text class="text-name">租赁类型:</text>
							<text class="text-value">
								{{
									itemData.rentType == 1
										? '经租'
										: itemData.rentType == 2
										? '以租代购'
										: itemData.rentType == 3
										? '展示车'
										: itemData.rentType == 4
										? '试驾车'
										: itemData.rentType == 5
										? '融租'
										: itemData.rentType == 6
										? '直购'
										: itemData.rentType == 7
										? '挂靠'
										: itemData.rentType == 8
										? '直营'
										: '--'
								}}
							</text>
						</view>

						<view class="text-line">
							<text class="text-name">客户名称:</text>
							<text class="text-value">{{ itemData.customerName | filterNull }}</text>
						</view>

						<view class="text-line" @click="makecall(itemData.customerTel)">
							<text class="text-name">联系电话:</text>
							<text class="text-value" style="flex-grow: unset">
								{{ itemData.customerTel | filterNull }}
							</text>
							<image
								style="width: 30rpx; height: 30rpx; margin-left: 10rpx"
								src="../../static/common/callPhone.png"
								mode="scaleToFill"></image>
						</view>

						<view class="text-line" v-if="itemData.rentType !== 6">
							<text class="text-name">租期:</text>
							<text class="text-value">{{ itemData.rentDateStr | filterNull }}</text>
						</view>
					</view>

					<view class="text-line">
						<text class="text-name">车牌号:</text>
						<text class="text-value">{{ itemData.carNo | filterNull }}</text>
					</view>

					<view class="text-line">
						<text class="text-name">品牌/车系/车型:</text>
						<text class="text-value">{{ itemData.brandSeriesModel | filterNull }}</text>
					</view>

					<view
						v-if="
							itemData.applyType == 12 ||
							itemData.applyType == 14 ||
							itemData.applyType == 16
						">
						<view class="text-line">
							<text class="text-name">车架号:</text>
							<text class="text-value">{{ itemData.vinNo | filterNull }}</text>
						</view>

						<view class="text-line">
							<text class="text-name">车辆状态:</text>
							<text class="text-value">{{ itemData.carStateStr | filterNull }}</text>
						</view>
					</view>

					<view v-if="itemData.applyType == 10">
						<view class="text-line">
							<text class="text-name">车架号:</text>
							<text class="text-value">{{ itemData.vinNo | filterNull }}</text>
						</view>

						<view class="text-line">
							<text class="text-name">当前仓库:</text>
							<text class="text-value">{{ itemData.depotName | filterNull }}</text>
						</view>

						<view class="text-line">
							<text class="text-name">移入仓库:</text>
							<text class="text-value">
								{{ itemData.purposeDepotName | filterNull }}
							</text>
						</view>

						<view class="text-line">
							<text class="text-name">移库原因:</text>
							<text class="text-value">
								{{ itemData.transferReason | filterNull }}
							</text>
						</view>
					</view>

					<view v-if="itemData.applyType == 13">
						<view class="text-line">
							<text class="text-name">交强险保单号:</text>
							<text class="text-value">{{ itemData.compulsoryNo | filterNull }}</text>
						</view>

						<view class="text-line">
							<text class="text-name">保险公司:</text>
							<text class="text-value">
								{{ itemData.compulsoryCompany | filterNull }}
							</text>
						</view>

						<view class="text-line">
							<text class="text-name">费用:</text>
							<text class="text-value">
								{{ itemData.compulsoryAmount | filterNull }}
							</text>
						</view>

						<view class="text-line">
							<text class="text-name">承运险保单号:</text>
							<text class="text-value">{{ itemData.carrierNo | filterNull }}</text>
						</view>

						<view class="text-line">
							<text class="text-name">保险公司:</text>
							<text class="text-value">
								{{ itemData.carrierCompany | filterNull }}
							</text>
						</view>

						<view class="text-line">
							<text class="text-name">费用:</text>
							<text class="text-value">
								{{ itemData.carrierAmount | filterNull }}
							</text>
						</view>

						<view class="text-line">
							<text class="text-name">商业险保单号:</text>
							<text class="text-value">{{ itemData.commercialNo | filterNull }}</text>
						</view>

						<view class="text-line">
							<text class="text-name">保险公司:</text>
							<text class="text-value">
								{{ itemData.commercialCompany | filterNull }}
							</text>
						</view>

						<view class="text-line">
							<text class="text-name">费用:</text>
							<text class="text-value">
								{{ itemData.commercialAmount | filterNull }}
							</text>
						</view>
					</view>

					<view v-if="itemData.applyType == 15">
						<view class="text-line">
							<text class="text-name">收车原因:</text>
							<text class="text-value">
								{{ itemData.collectReason | filterNull }}
							</text>
						</view>

						<view class="text-line">
							<text class="text-name">客户名称:</text>
							<text class="text-value">{{ itemData.customerName | filterNull }}</text>
						</view>

						<view class="text-line">
							<text class="text-name">收车时间:</text>
							<text class="text-value">{{ itemData.collectTime | filterNull }}</text>
						</view>
					</view>

					<view class="text-line" v-if="itemData.platForm">
						<text class="text-name" style="color: #1573ff">
							{{ itemData.platForm | filterNull }}
						</text>
					</view>

					<view
						class="text-line"
						v-for="(fitem, findex) in itemData.planMoneyList"
						:key="findex">
						<text class="text-name">{{ fitem.moenyDesc | filterNull }}</text>
						<text class="text-value">¥{{ fitem.moenyAmount | filterNull }}</text>
					</view>

					<view
						class="text-line"
						style="justify-content: flex-end"
						v-if="bigType != 2 && itemData.approveDesc">
						<text
							class="text-name"
							style="
								color: #ffc500;
								margin-right: 20rpx;
								white-space: nowrap;
								overflow: hidden;
								text-overflow: ellipsis;
							">
							{{ itemData.approveDesc | filterNull }}
						</text>
					</view>

					<view class="text-line" style="justify-content: flex-end" v-if="2 == bigType">
						<text
							class="text-name"
							style="color: #ffc500; margin-right: 20rpx; align-self: flex-end">
							{{ 1 == itemData.isRead ? '已读' : '未读' }}
						</text>
						<text
							style="
								width: 10rpx;
								height: 10rpx;
								border-radius: 90rpx;
								margin-right: 20rpx;
								margin-left: -10rpx;
							"
							:style="{
								'background-color': 1 == itemData.isRead ? '#2FC38D' : '#E93131',
							}"></text>
					</view>

					<view class="btn-content">
						<text
							v-for="(bitem, bindex) in itemData.buttonList"
							:key="bindex"
							@click="btnclick(itemData, bitem)">
							{{ bitem.btnName }}
						</text>
					</view>
				</view>
			</view>
		</mescroll-body>
	</view>
</template>

<script>
	import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js';

	export default {
		mixins: [MescrollMixin],
		data() {
			return {
				activeEnable: {},
				bigType: '',
				parentType: '',
				mKeyWords: '',
				applyType: '',
				reId: '',
				list: [
					// {
					// 	// name: '已读',
					// 	// num: 0
					// 	// count: 1
					// },
					// {
					// 	// name: '未读',
					// 	// count: 12345
					// 	// num: 0
					// },
				],
				current: 0,
				pageNo: 1,
				listdata: [],
			};
		},
		methods: {
			//切换标签
			tabChange(index) {
				console.log('标签切换了', index);
				this.current = index;

				this.pageNo = 1;
				this.getCountData();

				this.getListData();
			},

			searchChange(value) {
				this.pageNo = 1;
				this.getCountData();

				this.getListData();
			},

			//搜索框内容发生改变
			searchDidFinish(value) {
				this.pageNo = 1;
				this.getCountData();

				this.getListData();
			},

			getCountData() {
				this.$u.api
					.todoCount({
						type: this.bigType,
						applyType: this.applyType,
						orderInfo: this.mKeyWords,
						parentType: this.parentType,
						reId: this.reId,
					})
					.then(res => {
						res = res.map(item => {
							item.num = item.count;
							item.count = '';
							item.name = item.title;
							return item;
						});

						this.list = res;
						// this.list[1].name = res.noReadCount;
					});
			},

			getListData() {
				let flag = 2;
				if (this.current == 0) {
					flag = this.bigType == 3 ? -1 : 1;
				} else {
					flag = 2;
				}

				let params = {
					type: this.bigType,
					flag: flag,
					parentType: this.parentType,
					applyType: this.applyType,
					orderInfo: this.mKeyWords,
					reId: this.reId,
					pageNo: this.pageNo,
				};

				// if(this.bigType=='3'){
				//   params.instanceStatusList = '1,2,6'
				// }

				this.$u.api
					.todo(params)
					.then(res => {
						console.log(res);

						console.log('停止刷新');

						if (this.pageNo == 1) {
							this.listdata = [];
						}

						if (3 == this.bigType) {
							res.forEach(item => {
								if (5 == item.instanceStatus) {
									if (12 == item.applyType) {
										//维修
										item.buttonList = [
											{
												btnName: '重新发起',
												btnKey: 900,
											},
											...item.buttonList,
										];
									} else if (14 == item.applyType) {
										//出险
										item.buttonList = [
											{
												btnName: '重新发起',
												btnKey: 901,
											},
											...item.buttonList,
										];
									}
								}
							});
						}

						this.listdata = this.listdata.concat(res);
						this.mescroll.endSuccess(res.length);
					})
					.catch(() => {
						this.mescroll.endErr();
					});
			},

			upCallback(page) {
				console.log('触发了上拉加载' + page);

				this.pageNo = page.num;
				this.getListData();
			},

			btnclick(item, btn) {
				if (2 == this.bigType && 2 == item.isRead) {
					//抄送我的，并且是未读，调一下读消息接口
					this.$u.api
						.copystatusupdate({
							businessId: item.businessId,
							instanceId: item.instanceId,
						})
						.then(res => {});
				}

				let orderListBean = {
					contractId: item.contractId,
					orderCarId: item.orderCarId,
					orderCarCode: item.orderCarCode,
					alterationInstanceId: item.alterationInstanceId,
					orderCarStatusStr: item.approveStatusStr,
					orderId: item.orderId,
					carId: item.carId,
					customerId: item.customerId,
					rentType: item.rentType,
					approveDesc: item.approveDesc,
				};

				/**
				 * 提单审核分配交车:301
				 * 提单审核通过:302
				 * 提单审核驳回:303
				 * 提单审核拒绝:304
				 * 提单审核撤回:305
				 * 提单审核删除:306
				 * 提单审核详情(订单是审核中，拒绝等操作):307
				 * 提单驳回重新编辑/编辑:308
				 * 提交 10
				 * 暂存 9
				 *
				 * 提单无工作流：
				 * 订单过户 8
				 * 订单费用减免 7
				 * 订单申请换车 6
				 * 订单申请退车 5
				 * 订单分配交车 4
				 * 订单详情 3
				 * 订单修改 2
				 * 订单删除 1
				 *
				 * 退换车有工作流：
				 * 退换车重新编辑:401
				 * 退换车审批通过:402
				 * 退换车审批驳回:403
				 * 退换车审批拒绝:404
				 * 退换车审批撤回:405
				 *
				 * 调拨详情 512
				 * 调拨审核 507
				 *
				 * 维修重新提交 900（自己加的）
				 * 出险重新提交 901（自己加的）
				 */

				switch (btn.btnKey) {
					case 1:
					case 306:
						uni.navigateTo({
							url: '/pagesB/exam-order/exam-order?type=6&orderId=' + item.orderId,
						});
						break;
					case 2:
						let hasFlow = false;
						if (1 == item.rentType || 3 == item.rentType || 4 == item.rentType) {
							//经租/展示车/试驾车
							if (1 == this.activeEnable.longRentOrderApprove) {
								//长租有审批流
								hasFlow = true;
							} else {
								//长租无审批流
								hasFlow = false;
							}
						} else if (2 == item.rentType) {
							//租售
							if (1 == this.activeEnable.rentSaleOrderApprove) {
								//租售有审批流
								hasFlow = true;
							} else {
								//租售无审批流
								hasFlow = false;
							}
						} else if (5 == item.rentType) {
							//融租
							if (1 == this.activeEnable.meltsRentOrderApprove) {
								//融租有审批流
								hasFlow = true;
							} else {
								//融租无审批流
								hasFlow = false;
							}
						} else if (6 == item.rentType) {
							//直购
							if (1 == this.activeEnable.purchaseOrderApprove) {
								//直购有审批流
								hasFlow = true;
							} else {
								//直购无审批流
								hasFlow = false;
							}
						} else if (7 == item.rentType) {
							//挂靠
							if (1 == this.activeEnable.purchaseOrderApprove) {
								//直购有审批流
								hasFlow = true;
							} else {
								//直购无审批流
								hasFlow = false;
							}
						} else if (8 == item.rentType) {
							//直营
							if (1 == this.activeEnable.purchaseOrderApprove) {
								//直购有审批流
								hasFlow = true;
							} else {
								//直购无审批流
								hasFlow = false;
							}
						}

						if (hasFlow) {
							uni.navigateTo({
								url: '/pagesB/addorder/addorder-workflow?orderId=' + item.orderId,
							});
						} else {
							uni.navigateTo({
								url: '/pagesB/addorder/addorder?orderId=' + item.orderId,
							});
						}

						break;

					case 3:
						getApp().globalData.orderListBean = orderListBean;
						uni.navigateTo({
							url: '/pagesB/orderdetail/orderdetail',
						});
						break;

					case 4:
					case 301:
						uni.navigateTo({
							url:
								'/pagesB/distributecar/distributecar?orderCarId=' + item.orderCarId,
						});
						break;

					case 5:
						let flag = false;
						if (1 == item.rentType) {
							//长租退车
							flag = 1 == this.activeEnable.carBackApprove;
						} else if (2 == item.rentType) {
							//租售退车
							flag = 1 == this.activeEnable.rentSaleApprove;
						} else if (6 == item.rentType) {
							//直购退车
							flag = 1 == this.activeEnable.purchaseBackApprove;
						}
						if (flag) {
							//有工作流
							uni.navigateTo({
								url:
									'/pagesB/refundandchange/refundchange-workflow?returnCarType=2&rentType=' +
									item.rentType +
									'&orderCarNo=' +
									item.orderCarCode +
									'&orderCarId=' +
									item.orderCarId +
									'&instanceId=' +
									item.instanceId,
							});
						} else {
							uni.navigateTo({
								url:
									'/pagesB/refundandchange/refundchange?returnCarType=2&rentType=' +
									item.rentType +
									'&orderCarNo=' +
									item.orderCarCode +
									'&orderCarId=' +
									item.orderCarId,
							});
						}
						break;
					case 6:
						let flag2 = false;
						if (1 == item.rentType) {
							//长租换车
							flag2 = 1 == this.activeEnable.rentTransferCar;
						} else if (2 == item.rentType) {
							//租售换车 ???
							flag2 = 1 == this.activeEnable.rentSaleTransferCar;
						}
						if (flag2) {
							//有工作流
							uni.navigateTo({
								url:
									'/pagesB/refundandchange/refundchange-workflow?returnCarType=1&rentType=' +
									item.rentType +
									'&orderCarNo=' +
									item.orderCarCode +
									'&orderCarId=' +
									item.orderCarId +
									'&instanceId=' +
									item.instanceId,
							});
						} else {
							uni.navigateTo({
								url:
									'/pagesB/refundandchange/refundchange?returnCarType=1&rentType=' +
									item.rentType +
									'&orderCarNo=' +
									item.orderCarCode +
									'&orderCarId=' +
									item.orderCarId,
							});
						}
						break;
					case 8:
						break;
					case 302:
						uni.navigateTo({
							url: '/pagesB/exam-order/exam-order?type=3&orderId=' + item.orderId,
						});
						break;
					case 303:
						uni.navigateTo({
							url: '/pagesB/exam-order/exam-order?type=2&orderId=' + item.orderId,
						});
						break;
					case 304:
						uni.navigateTo({
							url: '/pagesB/exam-order/exam-order?type=1&orderId=' + item.orderId,
						});
						break;
					case 305:
						uni.navigateTo({
							url: '/pagesB/exam-order/exam-order?type=5&orderId=' + item.orderId,
						});
						break;
					case 307:
						let bizType = -1;
						let classify = -1;

						if (this.current > 0) {
							classify = 2;
						} else {
							if (1 == this.bigType || 2 == this.bigType) {
								classify = 1;
							}
						}

						//我审批的-已审批
						if (1 == this.bigType && 2 == classify) {
							bizType = 1;
						}

						getApp().globalData.orderListBean = orderListBean;

						uni.navigateTo({
							url: '/pagesB/exam-order/exam-orderdetail?bizType=' + bizType,
						});
						break;
					case 308:
						uni.navigateTo({
							url: '/pagesB/addorder/addorder-workflow?orderId=' + item.orderId,
						});
						break;
					case 401:
					case 407:
						if (
							uni.$u.test.isEmpty(item.returnCarType) ||
							uni.$u.test.isEmpty(item.orderCarCode) ||
							uni.$u.test.isEmpty(item.alterationInstanceId) ||
							uni.$u.test.isEmpty(item.rentType) ||
							uni.$u.test.isEmpty(item.approveStatusStr)
						) {
							this.$u.toast('数据异常');
							return;
						}
						console.log(this.current, 'this.current');
						// 退车有工作流跳转
						uni.navigateTo({
							url:
								'/pagesB/refundandchange/refundchange-detail-workflow?returnCarType=' +
								item.returnCarType +
								'&rentType=' +
								item.rentType +
								'&orderCarNo=' +
								item.orderCarCode +
								'&orderCarId=' +
								item.orderCarId +
								'&instanceId=' +
								item.alterationInstanceId +
								'&orderCarStatusStr=' +
								item.approveStatusStr +
								'&pageType=' +
								(this.bigType == 1 && this.current === 0 ? 'edit' : 'detail'),
						});
						break;
					case 507: //TODO 调拨审核
						if (uni.$u.test.isEmpty(item.carShiftId)) {
							this.$u.toast('数据异常');
							return;
						}

						uni.navigateTo({
							url:
								'/pagesB/dispatchcar/dispatchdetail?orderId=' +
								item.carShiftId +
								'&approveDesc=' +
								item.approveDesc +
								'&processKey=' +
								item.processKey +
								'&approveId=' +
								item.approveId +
								'&isShift=true' +
								'&bizType=' +
								(2 == this.bigType ? 1 : 0) +
								'&pageType=exam&approveStatusStr=' +
								item.approveStatusStr,
						});

						break;
					case 512:
						if (uni.$u.test.isEmpty(item.carShiftId)) {
							this.$u.toast('数据异常');
							return;
						}

						uni.navigateTo({
							url:
								'/pagesB/dispatchcar/dispatchdetail?orderId=' +
								item.carShiftId +
								'&approveDesc=' +
								item.approveDesc +
								'&processKey=' +
								item.processKey +
								'&approveId=' +
								item.approveId +
								'&isShift=shiftFalse' +
								'&bizType=1' +
								'&pageType=detail&approveStatusStr=' +
								item.approveStatusStr,
						});

						break;
					case 907: //催办
						if (uni.$u.test.isEmpty(item.instanceId)) {
							this.$u.toast('数据异常');
							return;
						}

						this.$u.api
							.getCuiBanPerson({
								instanceId: item.instanceId,
							})
							.then(res => {
								if (uni.$u.test.isEmpty(res)) {
									uni.makePhoneCall({
										phoneNumber: res[0].mobile,
									});
								}
							});

						break;
					case 2001: //维修：审核
						uni.navigateTo({
							url:
								'/pages/car/repair/car-repairDetail?carId=' +
								item.carId +
								'&pageType=myexam' +
								'&approveId=' +
								item.approveId +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId,
						});
						break;
					case 2002: //维修：详情
						uni.navigateTo({
							url:
								'/pages/car/repair/car-repairDetail?carId=' +
								item.carId +
								'&pageType=detail' +
								'&approveId=' +
								item.approveId +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId +
								'&bigType=' +
								this.bigType,
						});
						break;
					case 2003: //维修：重新编辑
						uni.navigateTo({
							url:
								'/pages/car/repair/car-addReapir?carId=' +
								item.carId +
								'&pageType=edit' +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId,
						});

						break;
					case 3001: //保险：审核
						uni.navigateTo({
							url:
								'/pages/renewal/renewaldetail?id=' +
								item.carId +
								'&businessId=' +
								item.businessId +
								'&instanceId=' +
								item.instanceId +
								'&approveId=' +
								item.approveId +
								'&pageType=myexam&noadd=1',
						});

						break;
					case 3002: //保险：详情
						uni.navigateTo({
							url:
								'/pages/renewal/renewaldetail?id=' +
								item.carId +
								'&businessId=' +
								item.businessId +
								'&instanceId=' +
								item.instanceId +
								'&pageType=detail&noadd=1',
						});

						break;
					case 3003: //保险：重新编辑
						uni.navigateTo({
							url:
								'/pagesB/edit-insurance/edit-insurance?instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId +
								'&pageType=edit',
						});

						break;
					case 4001: //出险：审核
						uni.navigateTo({
							url:
								'/pages/car/outdanger/car-outdangerDetail?carId=' +
								item.carId +
								'&approveId=' +
								item.approveId +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId +
								'&pageType=myexam',
						});

						break;
					case 4002: //出险：详情
						uni.navigateTo({
							url:
								'/pages/car/outdanger/car-outdangerDetail?carId=' +
								item.carId +
								'&approveId=' +
								item.approveId +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId +
								'&pageType=detail&bigType=' +
								this.bigType,
						});

						break;
					case 4003: //出险：重新编辑
						uni.navigateTo({
							url:
								'/pages/car/outdanger/car-addOutdanger?carId=' +
								item.carId +
								'&pageType=edit' +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId,
						});

						break;
					case 5001: //处置：审核
						uni.navigateTo({
							url:
								'/pagesA/disposal/disposaldetail?carId=' +
								item.carId +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId +
								'&approveId=' +
								item.approveId +
								'&pageType=myexam',
						});

						break;
					case 5002: //处置：详情
						uni.navigateTo({
							url:
								'/pagesA/disposal/disposaldetail?carId=' +
								item.carId +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId +
								'&pageType=detail',
						});

						break;
					case 5003: //处置：重新编辑
						uni.navigateTo({
							url:
								'/pagesA/disposal/add-disposal?carId=' +
								item.carId +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId +
								'&pageType=edit',
						});

						break;
					case 6001: //收车：审核
						uni.navigateTo({
							url:
								'/pagesA/collect-car/collect-detail?carId=' +
								item.carId +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId +
								'&approveId=' +
								item.approveId +
								'&pageType=myexam',
						});

						break;
					case 6002: //收车：详情
						uni.navigateTo({
							url:
								'/pagesA/collect-car/collect-detail?carId=' +
								item.carId +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId +
								'&pageType=detail',
						});

						break;
					case 6003: //收车：重新编辑
						uni.navigateTo({
							url:
								'/pagesA/collect-car/collect-add?carId=' +
								item.carId +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId +
								'&pageType=edit',
						});

						break;
					case 900: //维修重新发起
						uni.navigateTo({
							url:
								'/pages/car/repair/car-addReapir?carId=' +
								item.carId +
								'&pageType=edit' +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId +
								'&restart=1',
						});

						break;
					case 901: //出险重新发起
						uni.navigateTo({
							url:
								'/pages/car/outdanger/car-addOutdanger?carId=' +
								item.carId +
								'&pageType=edit' +
								'&instanceId=' +
								item.instanceId +
								'&businessId=' +
								item.businessId +
								'&restart=1',
						});

						break;
				}
			},

			makecall(phone) {
				if (!uni.$u.test.isEmpty(phone)) {
					uni.makePhoneCall({
						phoneNumber: phone,
					});
				}
			},
		},

		onShow() {
			this.pageNo = 1;
			this.getCountData();

			this.getListData();
		},

		onLoad(op) {
			this.bigType =
				op.bigType == 'null' || uni.$u.test.isEmpty(op.bigType) ? '' : op.bigType;
			this.parentType =
				op.parentType == 'null' || uni.$u.test.isEmpty(op.parentType) ? '' : op.parentType;
			this.applyType =
				op.applyType == 'null' || uni.$u.test.isEmpty(op.applyType) ? '' : op.applyType;
			this.reId = op.reId == 'null' || uni.$u.test.isEmpty(op.reId) ? '' : op.reId;

			this.activeEnable = this.$store.state.params.activitiEnable;

			switch (this.bigType) {
				case '1':
					uni.setNavigationBarTitle({
						title: '待我审批',
					});
					break;
				case '2':
					uni.setNavigationBarTitle({
						title: '抄送我的',
					});
					break;
				case '3':
					uni.setNavigationBarTitle({
						title: '我发起的',
					});
					break;
			}

			uni.$on('approval', res => {
				this.pageNo = 1;
				this.getCountData();

				this.getListData();
			});
		},
	};
</script>

<style lang="scss" scoped>
	.navi-search {
		position: relative;
		height: 72rpx;
		background-color: #fff;
		padding: 20rpx 20rpx;
	}

	.btn-content {
		display: flex;
		flex-wrap: wrap;
		margin: 0 0 20rpx 20rpx;
		justify-content: flex-end;

		text {
			width: 150rpx;
			line-height: 60rpx;
			text-align: center;
			color: #fff;
			border-radius: 90rpx;
			background-color: #1573ff;
			font-size: 26rpx;
			margin: 10rpx 20rpx 0 0;
		}
	}
</style>
